home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_nub_opencutscene.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  156 lines

  1. # Jones 3D Cog Script
  2. #
  3. # nub_OpenCutScene.cog
  4. #
  5. # [TL] et al...
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. #
  9. # ========================================================================================
  10. symbols
  11.  
  12. message        startup
  13. message        user0
  14. message        entered
  15.  
  16. thing        player            local
  17. thing        actor            local
  18. thing        nubsPresence
  19. thing        fadePlate
  20. thing        startCam
  21. thing        startGhost
  22.  
  23. sector        startSector
  24.  
  25. surface        entrancevoice
  26. sound        voice0=Nb01j01.wav        local #Shattered Dreams
  27. sound        CSmus=mus_nub_intro.wav    local # was mus_pyr_pyramid1.wav and also mus_bab_tablettrans.wav
  28. keyframe    in_one=0in_stand4.key    local
  29. template    tplActor=indy_sh_actor    local
  30. thing        camera
  31. thing        platform
  32.  
  33. int            voicedone=0                local
  34. int            bSeen=0            local
  35. flex        playerHealth    local
  36. vector        v_targetpos        local
  37.  
  38. end
  39.  
  40. # ========================================================================================
  41. code
  42.  
  43. startup:
  44.  
  45.     SetMasterCog(GetSelfCog()); # RT: Set master cog so we get autosave/restore message
  46.     return;
  47.  
  48. # ..............................................................................
  49.  
  50. user0: # RT: Indicates that autosave/restore has completed...
  51.  
  52.     if (bSeen) return; # RT
  53.     bSeen = 1;
  54.  
  55.     player = GetLocalPlayerThing();
  56.  
  57.     playerHealth = GetThingMaxHealth(player);
  58. #    SetSectorFlags(startSector, 0x1);
  59.     SetActorFlags(player, 0x200000);
  60.     #ClearActorFlags(player, 0x08);
  61.     StartCutscene(2);
  62.  
  63.     SetCameraLookInterp(2, 0);
  64.     SetCameraPosInterp(2, 0);
  65.     SetCameraFocus(2, startCam);
  66.     SetCameraSecondaryFocus(2, startGhost);
  67.     SetCurrentCamera(2);
  68.  
  69.     SetCollideType(fadePlate, 0);
  70.     ThingFadeAnim(fadePlate, 1, 0, 2.0, 0);
  71.     Sleep(2.0);
  72.     
  73. DestroyThing(platform);
  74. Sleep(2.0);
  75.  
  76.  
  77. #            #make the sector have gravity again
  78. #            ClearSectorFlags(startSector, 0x1);
  79. #            Sleep(0.1);
  80. #            
  81. #            #knock the player downward.
  82. #            SetThingVel(player, '0.0 0.0 -0.5');
  83. #            Sleep(1.5);
  84.  
  85.     
  86.     SetCameraPosition(1, GetThingPos(startCam));
  87.     SetCurrentCamera(1);
  88.     ClearActorFlags(player, 0x200000);
  89.     SetThingHealth(player, playerHealth);
  90.     #SetActorFlags(player, 0x08);
  91.     EndCutscene();
  92.  
  93.     return;
  94.  
  95. #........................................................................................
  96. entered:
  97.  
  98. if (GetSenderRef() == entrancevoice)
  99.     {
  100.     if (voicedone == 1)    return;
  101.     voicedone = 1;
  102.     
  103.     StartCutscene(1);
  104.     PlaySoundLocal(CSMus, 1.0, 0.0, 0x0, 0);
  105.     #Disable the player and put his weapon away.
  106.     MakeMeStop();
  107.     DeselectWeaponWait(player);
  108.     SetThingFlags(player, 0x80000);
  109.     
  110.     actor = CreateThing(tplActor, player);
  111.     ClearThingFlags(actor, 0x80000);
  112.     
  113.     SetCurrentCamera(2);
  114.     SetCameraFocus(2, camera);
  115.     SetCameraSecondaryFocus(2, actor);
  116.     SetCameraFOV(90, 0, 0.0);
  117.     
  118.     CopyPlayerHolsters(player, actor);
  119.     CaptureThing(actor);
  120.     AISetLookThing(actor, nubsPresence);
  121.     AIWaitForStop(actor);
  122.     Sleep(0.5);
  123.     
  124.     AIEnableHeadTracking(actor, nubsPresence);
  125.     MoveToFrame(nubsPresence, 2, 3.0);
  126.  
  127.     PlayVoice(actor, voice0, 1.0, 0);
  128.     #PlayKey(actor, in_one, 4, 0x12, 0);
  129.     MoveToFrame(camera, 1, 1.75);
  130.     WaitForStop(camera);
  131.     Sleep(0.3);
  132.     
  133.     CopyOrientandPos(actor, player);
  134.     SetThingFlags(actor, 0x80000);
  135.     AIDisableHeadTracking(actor);
  136.     ClearThingFlags(player, 0x80000);
  137.     ClearActorFlags(player, 0x200000);
  138.  
  139.     # revert cam
  140.     ResetCameraFOV(0, 0.0);
  141.     v_targetpos = VectorAdd(VectorTransformToOrient(player, '0.2 -0.05 0.0'), GetThingPos(player));    
  142.     SetCameraPosition(1, v_targetpos);
  143.     
  144.     SetCurrentCamera(1);
  145.     #SetCameraFocus(0, player);
  146.     DestroyThing(actor);
  147.     EndCutscene();
  148.     
  149.     }
  150.  
  151. return;
  152.  
  153. # ........................................................................................
  154. end
  155.  
  156.